package com.hnevc.xiaoming.shijianactivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.hnevc.xiaoming.R;

public class LongActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_long;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.long_layout);
        initView();

    }

    private void initView() {
        btn_long = (Button) findViewById(R.id.btn_long);

        btn_long.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                Toast.makeText(LongActivity.this, "长按识别二维码", Toast.LENGTH_SHORT).show();
                return false;
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
//            case R.id.btn_long:
//                Toast.makeText(LongActivity.this, "点击了按钮", Toast.LENGTH_SHORT).show();
//                break;
        }
    }
}
